﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XiaoBiao.aspx.cs" Inherits="Web.Pages.YongShui.YongHuGL.HuJiGL.XiaoBiao" Theme="Default"%>
<%@ Import Namespace="Platform.Permission" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>销表</title>
    <script src="../../../../JS/jquery-1.11.1.min.js"></script>
    <script src="../../../../JS/AddEditCancel.js"></script>
    <style type="text/css">
        .left { text-align: left; }

        .center { text-align: center; }

        .right { text-align: right; }

        table { width: 100%; }
    </style>
    <script type="text/javascript">
        function keyEnter(index) {
            var controls = new Array();
            controls[0] = document.getElementById("txtMINGCHENG_I");
            controls[1] = document.getElementById("ddlGUANLIK_I");
            controls[2] = document.getElementById("ddlSUOSHUSF_I");
            controls[3] = document.getElementById("txtWENJIANMMGZ_I");
            var key = event.keyCode;
            if (key == 13) {
                index = index + 1;
                if (index == controls.length) {
                    index = 0;
                }
                controls[index].focus();
            }
        }

        function deleteWaterMeter(waterMeterNumber,userId) {
            if (confirm("确定要对该水表进行销表吗？")) {
                $.ajax({
                    type: "POST",
                    url: "/ashx/DeleteWaterMeter.ashx",
                    data: "userid="+ userId +"&waterMeterNum=" + waterMeterNumber ,
                    cache: false,
                    success: function (data) {
                        alert(data);
                        document.getElementById("btnSearch").click();
                    },
                    error: function (data, error, error2) {
                        alert(error);
                        alert(error2);
                    }
                });
           }
        }

        function deleteWaterMeter2(waterMeterNumber, userId) {
            if (confirm("确定要对该水表进行销表吗？")) {
                $.ajax({
                    type: "POST",
                    url: "/ashx/DeleteWaterMeter.ashx",
                    data: "userid=" + userId + "&waterMeterNum=" + waterMeterNumber,
                    cache: false,
                    success: function (data) {
                        alert(data);
                        document.getElementById("btnSearch2").click();
                    },
                    error: function (data, error, error2) {
                        alert(error);
                        alert(error2);
                    }
                });
            }
        }
    </script>
</head>
<body>
<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="tabletitle1" align="center">
        销表
    </div>
    <asp:UpdatePanel ID="updatePanel1" runat="server">
        <ContentTemplate>
            <div>
                <fieldset style="border: 1px solid cornflowerblue">
                    <legend style="font-weight: bold">根据用户号销表</legend>
                    <table style="line-height: 22px; margin: auto;">
                        <tr>
                            <td width="100px" class="right">用户号：</td>
                            <td>
                                <table>
                                    <tr>
                                        <td style="width: 197px">
                                            <dx:ASPxTextBox ID="txtYongHuH" runat="server" Width="197px">
                                                <ClientSideEvents KeyPress="function(s,e){var key = event.keyCode;
                                        if( key==13){btnSearch.onClick();}}"/>
                                            </dx:ASPxTextBox>
                                        </td>
                                        <td>
                                            <dx:ASPxButton ID="btnSearch" ClientInstanceName="btnSearch" runat="server" Text="查找" OnClick="btnSearch_Click" UseSubmitBehavior="false"></dx:ASPxButton>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td class="right">用户名：</td>
                            <td>
                                <table>
                                    <tr>
                                        <td>
                                            <dx:ASPxTextBox ID="txtYongHuM" runat="server" Width="494px" Enabled="false"></dx:ASPxTextBox>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            </td>
                        </tr>
                        <tr>
                            <td class="right">用户地址：</td>
                            <td>
                                <table>
                                    <tr>
                                        <td>
                                            <dx:ASPxTextBox ID="txtDiZhi" runat="server" Width="494px" Enabled="false"></dx:ASPxTextBox>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <dx:ASPxGridView ID="gvList1" runat="server" AutoGenerateColumns="False" KeyFieldName="ID" Theme="Aqua1" Width="98%">
                        <Columns>
                            <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOBH" Caption="水表号" Width="20%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_DIZHI" Caption="水表地址" Width="40%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_MINGCHENG" Caption="水表户名" Width="40%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Width="35px">
                                <DataItemTemplate>
                                    <DataItemTemplate>
                                        <a href='javascript:deleteWaterMeter("<%#Eval("S_SHUIBIAOBH") %>"," <%= LoginHelper.UserID %>")'>销表</a>
                                    </DataItemTemplate>
                                </DataItemTemplate>
                            </dx:GridViewDataTextColumn>
                        </Columns>
                        <Settings VerticalScrollableHeight="130" VerticalScrollBarMode="Auto"/>
                    </dx:ASPxGridView>
                </fieldset>
            </div>
            <div style="height: 2px;"></div>
            <%--<fieldset style="border: 1px solid cornflowerblue">
                <legend style="font-weight: bold">根据水表号销表</legend>
                <table>
                    <tr>
                        <td style="text-align: right; width: 100px;">水表号：</td>
                        <td style="width: 197px">
                            <dx:ASPxTextBox ID="txtConShuiBiaoH" runat="server" Width="197px">
                                <ClientSideEvents KeyPress="function(s,e){var key = event.keyCode;
                                        if( key==13){$('#btnSearch2').click();}}"/>
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnSearch2" runat="server" Text="查找" UseSubmitBehavior="false" OnClick="btnSearch2_Click"></dx:ASPxButton>
                        </td>
                    </tr>
                </table>
                <dx:ASPxGridView ID="gvList2" runat="server" AutoGenerateColumns="False" KeyFieldName="S_SHUIBIAOBH" Theme="Aqua1" Width="98%"
                                 EnableCallBacks="false">
                    <Columns>
                        <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOBH" Caption="水表号" Width="20%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="S_SHUIBIAODZ" Caption="水表地址" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOHM" Caption="水表户名" Width="40%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Width="35px">
                            <DataItemTemplate>
                                <DataItemTemplate>
                                    <a href='javascript:deleteWaterMeter2(<%#Eval("S_SHUIBIAOBH") %>)'>销表</a>
                                </DataItemTemplate>
                            </DataItemTemplate>
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    <SettingsBehavior AllowFocusedRow="True" ProcessFocusedRowChangedOnServer="True"/>
                    <Settings VerticalScrollableHeight="120" VerticalScrollBarMode="Auto"/>
                </dx:ASPxGridView>
            </fieldset>--%>
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
</body>
</html>